import http from '../httpRequest'
class groupApi {}
// 创建群聊
groupApi.prototype.create = function(data) {
	return http({
		url: '/group/create',
		method: 'post',
		data: data
	})
}
// 查询群聊列表
groupApi.prototype.findgroupList = function() {
	return http({
		url: '/group/list',
		method: 'GET',
	});
}
// 查询群聊
groupApi.prototype.findgroup = function(data) {
	return http({
		url: `/group/find/` + data,
		method: 'GET'
		
	});
}
//查询是否被禁言
groupApi.prototype.isprohibition = function(data,type) {
	return http({
		url: `/group/isprohibition?id=` + data+'&type='+type,
		method: 'GET'
	});
}
// 邀请进群
groupApi.prototype.groupinvite = function(data) {
	return http({
		url: '/group/invite',
		method: 'POST',
		data: data
	})
}
// 查询群聊成员
groupApi.prototype.findgroupMember = function(data) {
	return http({
		url: `/group/members/` + data,
		method: 'GET',
	});
}
// 退出群聊
groupApi.prototype.quitGroup = function(data) {
	return http({
		url: `/group/quit/` + data,
		method: 'DELETE',
	});
}
//踢出群聊
groupApi.prototype.kickGroup = function(groupId, userId) {
	return http({
		url: `/group/kick?groupId=` + groupId + '&userId=' + userId,
		method: 'DELETE',
	});
}
//群详情
groupApi.prototype.getGroupInfo = function(data) {
	return http({
		url: `/group/getGroupInfo?id=` + data,
		method: 'GET',
	});
}

groupApi.prototype.getGroupQrCode = function(data) {
	return http({
		url: '/group/getGroupQrCode?groupId=' + data,
		method: 'GET',
	});
}

groupApi.prototype.update = function(data) {
	return http({
		url: `/group/update`,
		method: 'PUT',
		data:data
	});
}
//解散群聊
groupApi.prototype.del = function(data) {
	return http({
		url: `/group/delete/` + data,
		method: 'DELETE',
	});
}
// 禁言
groupApi.prototype.updateProhibitSpeak = function(data) {
	return http({
		url: `/group/updatejy`,
		method: 'PUT',
		data,
	});
}

groupApi.prototype.updateAdd = function(data) {
	return http({
		url: `/group/updateAdd`,
		method: 'PUT',
		data,
	});
}

groupApi.prototype.updateMember = function(data) {
	return http({
		url: `/group/updateMember`,
		method: 'PUT',
		data,
	});
}

export default groupApi;